//
//  MyBillTableViewCell.m
//  yonghu
//
//  Created by 浪尖渝力 on 2018/2/5.
//  Copyright © 2018年 com.DJS. All rights reserved.
//

#import "MyBillTableViewCell.h"

@implementation MyBillTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
-(void)creatView{
    self.backgroundColor=_LightGrey;
    
    NSNumber *order_time=[_dic objectForKey:@"order_time"];
    
    UILabel *timeLabel=[UILabel new];
    [self addSubview:timeLabel];
    [timeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(20);
        make.top.mas_equalTo(15);
    }];
    timeLabel.text=[ZQTools changeTimeCuo:@"HH:mm:ss YYYY-MM-dd " :[NSString stringWithFormat:@"%@",order_time]];
    timeLabel.textColor=ColorWithRGB(79, 79, 79);
    timeLabel.font=[UIFont systemFontOfSize:16];
    
    UIView *beiJingView=[UIView new];
    [self addSubview:beiJingView];
    [beiJingView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(20);
        make.right.mas_equalTo(-20);
        make.height.mas_equalTo(240);
        make.top.mas_equalTo(timeLabel.mas_bottom).mas_equalTo(5);
    }];
    beiJingView.layer.cornerRadius=5;
    beiJingView.backgroundColor=[UIColor whiteColor];
    
    UIView *topView=[UIView new];
    [beiJingView addSubview:topView];
    [topView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.top.mas_equalTo(0);
        make.height.mas_equalTo(60);
    }];
    topView.backgroundColor=_backgroundColor;
    
    NSNumber *order_type=[_dic objectForKey:@"order_type"];
    
    UILabel *order_typeLabel=[UILabel new];
    [topView addSubview:order_typeLabel];
    [order_typeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(0);
        make.left.mas_equalTo(15);
    }];
    order_typeLabel.textColor=[UIColor whiteColor];
    order_typeLabel.font=[UIFont systemFontOfSize:20];
    if (order_type.integerValue==0) {
        order_typeLabel.text=@"法律咨询";
    } if (order_type.integerValue==1) {
        order_typeLabel.text=@"代写文书";
    }if (order_type.integerValue==2) {
        order_typeLabel.text=@"个性服务";
    }if (order_type.integerValue==3) {
        order_typeLabel.text=@"案件委托 ";
    }if (order_type.integerValue==4) {
        order_typeLabel.text=@"咨询收听 ";
    }if (order_type.integerValue==5) {
        order_typeLabel.text=@"商场消费";
    }
    
    UILabel *zhiChu=[UILabel new];
    [beiJingView addSubview:zhiChu];
    [zhiChu mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.mas_equalTo(0);
        make.top.mas_equalTo(topView.mas_bottom).mas_equalTo(30);
    }];
    zhiChu.text=@"支出金额";
    zhiChu.textColor=ColorWithRGB(69, 69, 69);
    zhiChu.font=[UIFont systemFontOfSize:16];
    
    UILabel *moneyLabel=[UILabel new];
    [beiJingView addSubview:moneyLabel];
    [moneyLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.mas_equalTo(0);
        make.top.mas_equalTo(zhiChu.mas_bottom).mas_equalTo(20);
    }];
    NSString *order_money=[_dic objectForKey:@"order_money"];
    moneyLabel.text=[NSString stringWithFormat:@"-%@元",order_money];
    moneyLabel.font=[UIFont systemFontOfSize:22];
    moneyLabel.textColor=ColorWithRGB(29, 29, 29);
    
    
    UIView *xianView=[UIView new];
    [beiJingView addSubview:xianView];
    [xianView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.mas_equalTo(0);
        make.top.mas_equalTo(moneyLabel.mas_bottom).mas_equalTo(25);
        make.height.mas_equalTo(1);
    }];
    xianView.backgroundColor=_LightGrey;
    
    UILabel *label=[UILabel new];
    [beiJingView addSubview:label];
    [label mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(15);
        make.right.mas_equalTo(-15);
        make.top.mas_equalTo(xianView.mas_bottom).mas_equalTo(25);
    }];
    NSString *order_number=[_dic objectForKey:@"order_info"];
   
    label.text=order_number;

    label.font=[UIFont systemFontOfSize:16];
    label.textColor=ColorWithRGB(59, 59, 59);
    
    
}

-(void)creatView2{
    self.backgroundColor=_LightGrey;
    
    NSNumber *order_time=[_dic objectForKey:@"integral_time"];
    
    UILabel *timeLabel=[UILabel new];
    [self addSubview:timeLabel];
    [timeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(20);
        make.top.mas_equalTo(15);
    }];
    timeLabel.text=[ZQTools changeTimeCuo:@"HH:mm:ss YYYY-MM-dd " :[NSString stringWithFormat:@"%@",order_time]];
    timeLabel.textColor=ColorWithRGB(79, 79, 79);
    timeLabel.font=[UIFont systemFontOfSize:16];
    
    UIView *beiJingView=[UIView new];
    [self addSubview:beiJingView];
    [beiJingView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(20);
        make.right.mas_equalTo(-20);
        make.height.mas_equalTo(240);
        make.top.mas_equalTo(timeLabel.mas_bottom).mas_equalTo(5);
    }];
    beiJingView.layer.cornerRadius=5;
    beiJingView.backgroundColor=[UIColor whiteColor];
    
    UIView *topView=[UIView new];
    [beiJingView addSubview:topView];
    [topView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.top.mas_equalTo(0);
        make.height.mas_equalTo(60);
    }];
    topView.backgroundColor=_backgroundColor;
    
    NSNumber *order_type=[_dic objectForKey:@"integral_amount"];
    
    UILabel *order_typeLabel=[UILabel new];
    [topView addSubview:order_typeLabel];
    [order_typeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(0);
        make.left.mas_equalTo(15);
    }];
    order_typeLabel.textColor=[UIColor whiteColor];
    order_typeLabel.font=[UIFont systemFontOfSize:20];
    if (order_type.doubleValue>=0) {
        order_typeLabel.text=@"积分收入";
    } if (order_type.doubleValue<0) {
        order_typeLabel.text=@"积分支出";
    }
    
    UILabel *allLabel=[UILabel new];
    [topView addSubview:allLabel];
    [allLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(0);
        make.right.mas_equalTo(-15);
    }];
    allLabel.textColor=[UIColor whiteColor];
    allLabel.font=[UIFont systemFontOfSize:20];
    allLabel.text=[NSString stringWithFormat:@"当前积分:%@",[_dic objectForKey:@"integral_surplus"]];
   
    UILabel *moneyLabel=[UILabel new];
    [beiJingView addSubview:moneyLabel];
    [moneyLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.mas_equalTo(0);
        make.top.mas_equalTo(topView.mas_bottom).mas_equalTo(30);
    }];
    NSString *order_money=[_dic objectForKey:@"integral_amount"];
    moneyLabel.text=[NSString stringWithFormat:@"%@积分",order_money];
    moneyLabel.font=[UIFont systemFontOfSize:22];
    moneyLabel.textColor=ColorWithRGB(29, 29, 29);
    
    
    UIView *xianView=[UIView new];
    [beiJingView addSubview:xianView];
    [xianView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.mas_equalTo(0);
        make.top.mas_equalTo(moneyLabel.mas_bottom).mas_equalTo(25);
        make.height.mas_equalTo(1);
    }];
    xianView.backgroundColor=_LightGrey;
    
    UILabel *label=[UILabel new];
    [beiJingView addSubview:label];
    [label mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(15);
        make.right.mas_equalTo(-15);
        make.top.mas_equalTo(xianView.mas_bottom).mas_equalTo(25);
    }];
    NSString *order_number=[_dic objectForKey:@"integral_info"];
    
    label.text=order_number;
    
    label.font=[UIFont systemFontOfSize:16];
    label.textColor=ColorWithRGB(59, 59, 59);
    
    
}


@end
